import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useEmployeeStore = defineStore(
  'employee',
  () => {
    const employeeInfo = ref({})
    const logoutStatus = ref(true)
    const setEmployeeInfo = (employee) => {
      employeeInfo.value = employee
      logoutStatus.value = false
    }
    const removeEmployeeInfo = () => {
      employeeInfo.value = {}
      logoutStatus.value = true
    }
    return { employeeInfo, setEmployeeInfo, removeEmployeeInfo, logoutStatus }
  },
  {
    persist: true
  }
)
